more use of qPrintable instead of CSTR or CSTRc with fatal and printf.
authortsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 18 Sep 2014 17:57:39 +0000 (17:57 +0000)
committertsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 18 Sep 2014 17:57:39 +0000 (17:57 +0000)
12 files changed:
gpsbabel/garmin_txt.cc
gpsbabel/gdb.cc
gpsbabel/geo.cc
gpsbabel/lowranceusr.cc
gpsbabel/lowranceusr4.cc
gpsbabel/mapfactor.cc
gpsbabel/navicache.cc
gpsbabel/raymarine.cc
gpsbabel/trackfilter.cc
gpsbabel/unicsv.cc
gpsbabel/xmlgeneric.cc
gpsbabel/xol.cc

index 27548afd0a2e2d68e63ebb138f5b0b794cfd208b..c88ed950e2383e8d512af0f4f4aa1ff691796b83 100644 (file)
@@ -354,7 +354,7 @@ print_position(const Waypoint* wpt)
   if (! valid) {
     gbfprintf(fout, "#####\n");
     fatal(MYNAME ": %s (%s) is outside of convertable area \"%s\"!\n",
-          wpt->shortname.isEmpty() ? "Waypoint" : CSTR(wpt->shortname),
+          wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname),
           pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0),
           gt_get_mps_grid_longname(grid_index, MYNAME));
   }
index ba16219255ab1e13f1b3af99d0841f17257165a7..f2b0658257cd727f9ad3e6410233ceadbf44f77d 100644 (file)
@@ -1319,10 +1319,10 @@ gdb_check_waypt(Waypoint* wpt)
 
   if ((wpt->latitude < -90) || (wpt->latitude > 90.0))
     fatal("Invalid latitude %f in waypoint %s.\n",
-          lat_orig, !wpt->shortname.isEmpty() ? CSTRc(wpt->shortname) : "<no name>");
+          lat_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : "<no name>");
   if ((wpt->longitude < -180) || (wpt->longitude > 180.0))
     fatal("Invalid longitude %f in waypoint %s.\n",
-          lon_orig, !wpt->shortname.isEmpty() ? CSTRc(wpt->shortname) : "<no name>");
+          lon_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : "<no name>");
 }
 
 /*-----------------------------------------------------------------------------*/
index dc57f5ad1b3020197812c5e683b57784b7305082..6d7a371350342a10129b39ba925b80278e8e230f 100644 (file)
@@ -114,8 +114,8 @@ geo_read(void)
   GeoReadLoc();
   if (reader.hasError())  {
     fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
-          CSTR(reader.errorString()),
-          CSTR(file.fileName()),
+          qPrintable(reader.errorString()),
+          qPrintable(file.fileName()),
           (long) reader.lineNumber(),
           (long) reader.columnNumber());
   }
index b825460ac3900e0abca7c1c949370c71588e4702..42cd8640b432758b1548f53126bedf5dd8a43e87 100644 (file)
@@ -918,7 +918,7 @@ lowranceusr_route_hdr(const route_head* rte)
 
   if (global_opts.debug_level >= 1)
     printf(MYNAME " route_hdr: route name \"%s\" num_legs = %d\n",
-           CSTRc(rte->rte_name), num_legs);
+           qPrintable(rte->rte_name), num_legs);
 
 }
 
index 2ca8b05367ab94fc8c3960dbc09df2b9b555b8e8..a6b59837b82038d6ef4e928178a026631e888b12 100644 (file)
@@ -319,7 +319,7 @@ register_waypt(const Waypoint* ref)
 
   if (global_opts.debug_level >= 2) {
     printf(MYNAME " adding waypt %s (%s) to table at index %d\n",
-           CSTRc(wpt->shortname), CSTRc(wpt->description), waypt_table_ct);
+           qPrintable(wpt->shortname), qPrintable(wpt->description), waypt_table_ct);
   }
 
   waypt_table[waypt_table_ct] = (Waypoint*)wpt;
@@ -461,7 +461,7 @@ lowranceusr4_parse_waypoints(void)
     if (global_opts.debug_level >= 1) {
       printf(MYNAME " parse_waypoints: name = %s, uid_unit = %u, "
              "uid_seq_low = %d, uid_seq_high = %d, lat = %f, lon = %f, depth = %f\n",
-             CSTRc(wpt_tmp->shortname), fsdata->uid_unit,
+             qPrintable(wpt_tmp->shortname), fsdata->uid_unit,
              fsdata->uid_seq_low, fsdata->uid_seq_high,
              wpt_tmp->latitude, wpt_tmp->longitude, wpt_tmp->depth);
     }
@@ -557,7 +557,7 @@ lowranceusr4_parse_routes(void)
 
     if (global_opts.debug_level >= 1) {
       printf(MYNAME " parse_routes: route name=%s has %d waypoints\n",
-             CSTRc(rte_head->rte_name), num_legs);
+             qPrintable(rte_head->rte_name), num_legs);
     }
 
     for (j = 0; j < num_legs; ++j) {
@@ -568,7 +568,7 @@ lowranceusr4_parse_routes(void)
       if (wpt_tmp) {
         if (global_opts.debug_level >= 2) {
           printf(MYNAME " parse_routes: added wpt %s to route %s\n",
-                 CSTRc(wpt_tmp->shortname), CSTRc(rte_head->rte_name));
+                 qPrintable(wpt_tmp->shortname), qPrintable(rte_head->rte_name));
         }
         route_add_wpt(rte_head, new Waypoint(*wpt_tmp));
       }
@@ -685,7 +685,7 @@ lowranceusr4_parse_trails(void)
 
     if (global_opts.debug_level >= 1) {
       printf(MYNAME " parse_trails: trail %d name=%s has %d trackpoints\n",
-             trk_num, CSTRc(trk_head->rte_name), num_trail_pts);
+             trk_num, qPrintable(trk_head->rte_name), num_trail_pts);
     }
 
     for (j = 0; j < num_trail_pts; ++j) {
@@ -713,7 +713,7 @@ lowranceusr4_parse_trails(void)
 
       if (global_opts.debug_level >= 2) {
         printf(MYNAME " parse_routes: added trackpoint %f,%f to route %s\n",
-               wpt_tmp->latitude, wpt_tmp->longitude, CSTRc(trk_head->rte_name));
+               wpt_tmp->latitude, wpt_tmp->longitude, qPrintable(trk_head->rte_name));
       }
     }
   }
@@ -854,7 +854,7 @@ lowranceusr4_write_waypoints(void)
   for (i = 0; i < waypt_table_ct; ++i) {
     if (global_opts.debug_level >= 2) {
       printf(MYNAME " writing out waypt %d (%s - %s)\n",
-             i, CSTRc(waypt_table[i]->shortname), CSTRc(waypt_table[i]->description));
+             i, qPrintable(waypt_table[i]->shortname), qPrintable(waypt_table[i]->description));
     }
     lowranceusr4_waypt_disp((const Waypoint*)waypt_table[i]);
   }
@@ -865,7 +865,7 @@ lowranceusr4_write_route_hdr(const route_head* rte)
 {
   if (global_opts.debug_level >= 1) {
     printf(MYNAME " writing route #%d (%s) with %d waypts\n",
-           route_uid, CSTRc(rte->rte_name), rte->rte_waypt_ct);
+           route_uid, qPrintable(rte->rte_name), rte->rte_waypt_ct);
   }
 
   /* UID unit number */
@@ -895,10 +895,10 @@ lowranceusr4_write_wpt_uids(const Waypoint* wpt)
   if (global_opts.debug_level >= 2) {
     if (waypt_idx > waypt_table_ct) {
       printf(MYNAME " WARNING: failed finding waypoint %s in waypoint table\n",
-             CSTRc(wpt->shortname));
+             qPrintable(wpt->shortname));
     } else {
       printf(MYNAME " adding waypt %d (%s) to route\n",
-             waypt_idx, CSTRc(waypt_table[waypt_idx]->shortname));
+             waypt_idx, qPrintable(waypt_table[waypt_idx]->shortname));
     }
   }
 
@@ -932,7 +932,7 @@ lowranceusr4_write_track_hdr(const route_head* trk)
 {
   if (global_opts.debug_level >= 1) {
     printf(MYNAME " writing track %d (%s) with %d trackpoints\n",
-           track_uid, CSTRc(trk->rte_name), trk->rte_waypt_ct);
+           track_uid, qPrintable(trk->rte_name), trk->rte_waypt_ct);
   }
 
   /* UID unit number */
index 3d0912c1047e820d8bca256990c4bdbee0c980ae..f0320ac9223b7e5272d60e36d6135987044a7f4b 100644 (file)
@@ -85,8 +85,8 @@ mapfactor_read(void)
   MapfactorRead();
   if (reader.hasError())  {
     fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
-          CSTR(reader.errorString()),
-          CSTR(file.fileName()),
+          qPrintable(reader.errorString()),
+          qPrintable(file.fileName()),
           (long) reader.lineNumber(),
           (long) reader.columnNumber());
   }
index 26008fdc30febcd721a96b48e5b74c4348e0cc40..db910daa77379a3f76a06cbad121602930625830 100644 (file)
@@ -195,8 +195,8 @@ nav_read(void)
   }
   if (reader.hasError())  {
     fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
-          CSTR(reader.errorString()),
-          CSTR(file.fileName()),
+          qPrintable(reader.errorString()),
+          qPrintable(file.fileName()),
           (long) reader.lineNumber(),
           (long) reader.columnNumber());
   }
index 24fd69dc0c43437c5c3763eb7b52da77737c6d78..eee63d622f4c21578bb3bc6a86a7fe9f8a5182c4 100644 (file)
@@ -261,7 +261,7 @@ raymarine_read(void)
       wpt = find_waypt_by_name(str);
       if (wpt == NULL)
         fatal(MYNAME ": No associated waypoint for route point %s (Route %s)!\n",
-              str, CSTRc(rte->rte_name));
+              str, qPrintable(rte->rte_name));
 
       route_add_wpt(rte, new Waypoint(*wpt));
     }
index d7e8b212ed5b74e26a76a02c6bc51ef115592982..b526ddf210ea4a40cd262b094630fba914c32614 100644 (file)
@@ -473,8 +473,8 @@ trackfilter_pack(void)
     prev = track_list[j];
     if (prev.last_time >= track_list[i].first_time) {
       fatal(MYNAME "-pack: Tracks overlap in time! %s >= %s at %d\n",
-        CSTR(prev.last_time.toString()), 
-        CSTR(track_list[i].first_time.toString()), i);
+        qPrintable(prev.last_time.toString()), 
+        qPrintable(track_list[i].first_time.toString()), i);
     }
   }
 
index 86116b4f431163ce88dd378a36b2ebfbd173e77e..fa01961681adabe020e1ea94eaec012644c43e75 100644 (file)
@@ -1249,7 +1249,7 @@ unicsv_fatal_outside(const Waypoint* wpt)
 {
   gbfprintf(fout, "#####\n");
   fatal(MYNAME ": %s (%s) is outside of convertable area of grid \"%s\"!\n",
-        wpt->shortname.isEmpty() ? "Waypoint" : CSTR(wpt->shortname),
+        wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname),
         pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0),
         gt_get_mps_grid_longname(unicsv_grid_idx, MYNAME));
 }
index 0e5232efadd56e35fe19b19c0d7abad11764b602..7acaaafe275ec640c5b059495e8b63ec5d93d1a3 100644 (file)
@@ -184,8 +184,8 @@ void xml_read(void)
   xml_run_parser(reader, current_tag);
   if (reader.hasError())  {
     fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
-          CSTR(reader.errorString()),
-          CSTR(file.fileName()),
+          qPrintable(reader.errorString()),
+          qPrintable(file.fileName()),
           (long) reader.lineNumber(),
           (long) reader.columnNumber());
   }
@@ -218,7 +218,7 @@ void xml_readstring(const char* str)
   xml_run_parser(reader, current_tag);
   if (reader.hasError())  {
     fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
-          CSTR(reader.errorString()),
+          qPrintable(reader.errorString()),
           "unknown",
           (long) reader.lineNumber(),
           (long) reader.columnNumber());
index 3a6eee20b350da71ad0d1f989fa69ec0e8b86465..719f0946c005610f10e01fef1bdf0654687f4c70 100644 (file)
@@ -60,7 +60,7 @@ xol_overlay(xg_string args, const QXmlStreamAttributes* attrv)
   if (attrv->hasAttribute("version")) {
     if (attrv->value("version") != "1.0") {
       fatal(MYNAME ": Unsupported version %s.\n",
-            attrv->value("version").toString().toUtf8().constData());
+            qPrintable(attrv->value("version").toString()));
     }
   }
 }
@@ -166,7 +166,7 @@ xol_fatal_outside(const Waypoint* wpt)
 {
   gbfprintf(fout, "#####\n");
   fatal(MYNAME ": %s (%s) is outside of convertable area \"%s\"!\n",
-        wpt->shortname.isEmpty() ? "Waypoint" : CSTRc(wpt->shortname),
+        wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname),
         pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0),
         gt_get_mps_grid_longname(grid_swiss, MYNAME));
 }